/**
 * 
 */
package ar.edu.unq.tpi.uis.tepe3.dominio;

import java.util.HashSet;
import java.util.Set;

/**
 * @author daniel
 *
 */
public class Group extends Grantable {

	private Set<User> users;

	public Group(){
		super();
		this.users = new HashSet<User>();
	}
	
	public Group(String name){
		this();
		this.setName(name);
	}
	
	public Boolean hasUser(User aUser) {
		return this.users.contains(aUser);
	}
	
	public void addUser(User aUser){
		this.users.add(aUser);
	}
	
	public void removeUser(User aUser){
		this.users.remove(aUser);
	}

	public Set<User> getUsers() {
		return users;
	}
	
	private void setUsers(Set<User> users){
		this.users = users;
	}
	
	public String toString(){
		return this.getName();
	}

}
